package com.ruoyi.web.controller.system;


import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.UserPie;
import com.ruoyi.system.domain.YcBar;
import com.ruoyi.system.service.IUserPieService;
import com.ruoyi.system.service.IYcBarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
/**
 * 数据录入Controller
 *
 * @author YuHaoxiang
 * @date 2022-10-15
 */
//Controller
@RestController
@RequestMapping("/dashboard/ycbar")
public class YcBarController extends BaseController {
    @Autowired
    private IYcBarService ycBarService;

    @ResponseBody
    @GetMapping("listYcBar")
    public  TableDataInfo listYcBar(YcBar ycBar){
        List<YcBar> listYcBar = ycBarService.selectYcBarList(ycBar);
        return getDataTable(listYcBar);
    }

    @ResponseBody
    @GetMapping("listYcBarByYear")
    public  TableDataInfo listYcBarByYear(YcBar ycBar){
        List<YcBar> listYcBarByYear = ycBarService.selectYcBarListByYear(ycBar);
        return getDataTable(listYcBarByYear);
    }

    @ResponseBody
    @GetMapping("/listYcLineRanking")
    public TableDataInfo listYcLineRanking(YcBar ycBar){
        List<YcBar> listYcLineRanking = ycBarService.selectYcLineRankingByParams(ycBar);
        return getDataTable(listYcLineRanking);
    }
}
